<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html">
<f:view>
	<f:metadata>
		<f:viewParam name="categoryId" value="#{categoryController.categoryId}" required="true" />
		<f:event type="preRenderView" listener="#{categoryController.findCategory()}" />
	</f:metadata>
	<h:head>
		<title>editCategory</title>
		<meta http-equiv="Content-Type"
			content="application/xhtml+xml; charset=UTF-8" />
	</h:head>
	<h:body>
		<h2>Edit Category</h2>

		<h:form>
			<!--h:inputHidden id="categoryId" value="#{categoryController.categoryId}">
				<f:event type="preValidate" listener="#{categoryController.findCategory()}"></f:event> 
			</h:inputHidden-->
		
			<h:panelGrid columns="3">
					
				<h:outputText value="#{msg.category_name}:" />
				<h:inputText value="#{categoryController.category.name}" />

				<h:outputText value="" />

				<h:outputText value="#{msg.category_directory}:" />
				<h:inputText id="dir"
					value="#{categoryController.category.directory}" />
				<h:message for="dir" style="color: red;" />
  
			</h:panelGrid>

			<div>
				<h:commandButton type="submit" value="Change"
					action="#{categoryController.updateCategory}" />
			
			</div>

		</h:form>
		
		<f:phaseListener type="com.katydid.web.PhaseTracker"/>
	</h:body>
</f:view>
</html>